import { v4 as uuidv4 } from 'uuid';
import stroage from '@/utils/localStorage.js'
export const getUUID = () => {
    //生成一个随机的字符串,游客身份持久存储
    //先从本地存储中取出
    let uuid = stroage.getItem('uuid_token');
    if(!uuid){//如果没有,再生成一个并存储
        uuid = uuidv4();
        stroage.setItem('uuid_token',uuid);
    }
    return uuid;
}